import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from "path";

export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: {
            '@': resolve(__dirname, './src'),
            "@assets": resolve(__dirname, "src/assets"),
            "@components": resolve(__dirname, "src/components"),
            "@images": resolve(__dirname, "src/assets/images"),
            "@views": resolve(__dirname, "src/views"),
            "@store": resolve(__dirname, "src/store"),
        }
    },
    server: {
        host: '127.0.0.1',
        port: 3000,
        open: true,
        proxy: {
            '/api': {
                target: '你的服务器地址',
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/api/, '')
            }
        }
    }
})
